package com.tanhua.dubbo.mappers;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tanhua.model.domain.BlackList;
import com.tanhua.model.domain.UserInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface BlackListMapper extends BaseMapper<BlackList> {

    @Select("SELECT * FROM tb_user_info userInfo INNER JOIN (SELECT black_user_id FROM tb_black_list WHERE user_id = #{id}) black ON black.black_user_id = userInfo.id")
    IPage<UserInfo> getByUserIdBlack(@Param("id") Long id, @Param("page") Page page);
}